{capture name=path}{l s='Shipping'}{/capture}
{include file=$tpl_dir./breadcrumb.tpl}

<h2>{l s='Order summation' mod='kreditor'}</h2>

{assign var='current_step' value='payment'}
{include file=$tpl_dir./order-steps.tpl}
{if !empty($errors)}
	<div class="error">
		<p>{$errors}</p>
	</div>
{/if}

<h3>{l s='Kreditor payment' mod='kreditor'}</h3>

<form action="{$this_path_ssl}validation.php" method="post">
<input type="hidden" name="confirm" value="1" />
<p>
	<img src="{$this_path}logos/{$country->iso_code|lower}.png" alt="{l s='Kreditor payment' mod='kreditor'}" style="float:left; margin: 0px 10px 5px 0px;" />
	{l s='You have chosen the Kreditor method.' mod='kreditor'}
	<br/><br />
	{l s='The total amount of your order is' mod='kreditor'}
	<span id="amount_{$currencies.0.id_currency}" class="price">{convertPriceWithCurrency price=$total currency=$currency}</span>.
{if !empty($invoicefee)}
	<br />
	{l s='Invoice fee' mod='kreditor'}
	<span id="amount_{$currencies.0.id_currency}" class="price">{$invoicefee}{$currency->iso_code}</span>
	{l s='not included.' mod='kreditor'}
{/if}
</p>
      <table>
		<tr>
			<td>{l s='Conditions' mod='kreditor'}</td><td><A href="javascript:void();" onclick="window.open('https://www.kreditor.se/villkor{if $country->iso_code|lower != 'se'}_{$country->iso_code|lower}{/if}.yaws?eid={$eid}&charge={$invoicefee}','villkor','width=300,height=300,scrollbars=no');">{l s='Terms of payment 14 days' mod='kreditor'}</A></td>
		</tr>
		{if $country->iso_code|lower eq "de" || $country->iso_code|lower eq "nl"}
		<tr>
			<td>{l s='Gender' mod='kreditor'}</td>
			<td><input type="radio" name="klarna_gender" value="1" {if $customer->id_gender eq 1}checked="checked"{/if}>{l s='Male' mod='kreditor'}&nbsp;<input type="radio" name="klarna_gender" value="0"{if $customer->id_gender eq 2}checked="checked"{/if}>{l s='Female' mod='kreditorpartpayment'}</td>
		</tr>
		{/if}
		<tr>
			<td>{l s='Person number:' mod='kreditor'}</td><td><input type="text" name="kreditor_pnum" value="{$pno}" /></td>
		</tr>
		<tr>
			<td>{l s='Telephone:' mod='kreditor'}</td><td><input type="text" name="kreditor_telephone" value="{$telephone}" /></td>
		</tr>
		{if $country->iso_code|lower eq "de" || $country->iso_code|lower eq "nl"}
		<tr>
			<td>{l s='Street/Housenum:' mod='kreditor'}</td><td><input type="text" name="kreditor_street_de" value="{$address->address1}" /><input type="text" name="kreditor_house" value="{$address->housenum}" size="6" /></td>
		</tr>
		{/if}
		{if $country->iso_code|lower eq "nl"}
		<tr>
			<td>{l s='House extension:' mod='kreditor'}</td><td><input type="text" name="kreditor_houseext" value="{$address->houseext}" /></td>
		</tr>
		{/if}
		<tr>
			<td>{l s='E-mail:' mod='kreditor'}</td><td><input type="text" name="kreditor_email" size="30" value="{$email}" /></td>
		</tr>
	</table>
<p>
	<br /><br />
	<b>{l s='Please confirm your order by clicking \'I confirm my order\'' mod='kreditor'}.</b>
</p>
<p class="cart_navigation">
	<a href="{$base_dir_ssl}order.php?step=3" class="button_large">{l s='Other payment methods' mod='kreditor'}</a>
	<input type="submit" name="submit" value="{l s='I confirm my order' mod='kreditor'}" class="exclusive_large" />
</p>
	<input type="hidden" name="upload" value="1" />
	<input type="hidden" name="kreditor_fname" value="{$address->firstname}" />
	<input type="hidden" name="kreditor_lname" value="{$address->lastname}" />
	<input type="hidden" name="kreditor_street" value="{$address->address1}" />
	{if !empty($address->address2)}<input type="hidden" name="address2" value="{$address->address2}" />{/if}
	<input type="hidden" name="kreditor_city" value="{$address->city}" />
	<input type="hidden" name="kreditor_postno" value="{$address->postcode}" />
	<input type="hidden" name="country" value="{$country->iso_code}" />
	<input type="hidden" name="amount" value="{$amount}" />
	<input type="hidden" name="email" value="{$customer->email}" />
{if !$discounts}
	<input type="hidden" name="shipping_1" value="{$shipping}" />
	{counter assign=i}
	{foreach from=$products item=product}
	<input type="hidden" name="item_name_{$i}" value="{$product.name}{if isset($product.attributes)} - {$product.attributes}{/if}" />
	<input type="hidden" name="amount_{$i}" value="{$product.KreditorAmount}" />
	<input type="hidden" name="quantity_{$i}" value="{$product.quantity}" />
	{counter print=false}
	{/foreach}
{else}
	<input type="hidden" name="item_name_1" value="{l s='My cart' mod='kreditor'}" />
	<input type="hidden" name="amount_1" value="{$total}" />
	<input type="hidden" name="quantity_1" value="1" />
{/if}
	<input type="hidden" name="business" value="{$business}" />
	<input type="hidden" name="receiver_email" value="{$business}" />
	<input type="hidden" name="cmd" value="_cart" />
	<input type="hidden" name="charset" value="utf-8" />
	<input type="hidden" name="currency" value="{$currency->iso_code}" />
	<input type="hidden" name="payer_id" value="{$customer->id}" />
	<input type="hidden" name="payer_email" value="{$customer->email}" />
	<input type="hidden" name="custom" value="{$id_cart}" />
	<input type="hidden" name="return" value="{$goBackUrl}" />
	<input type="hidden" name="notify_url" value="{$returnUrl}" />
    <input type="hidden" name="rm" value="1" />
	<input type="hidden" name="bn" value="PRESTASHOP_WPS" />
</form>